package com.zs.util;

/**
 * @BelongsProject: trio
 * @BelongsPackage: com.trio.util
 * @Author:DuoErGun
 * @CreateTime: 2019-05-07 13:29
 * @Description: 返回结果类
 * @Emil: 381889220@qq.com
 */
public class Result {

    /**
     * 响应值 5 代表tokenId过期 需要重新进入登录页面
     */
    private Integer code;
    /**
     * 是否成功
     */
    private boolean success;
    /**
     * 信息
     */
    private String message;
    /**
     * 备注
     */
    private Object remarks;



    public Result() {
    }

    public Result(String message, Object remarks) {
        this.success = false;
        this.message = message;
        this.remarks = remarks;
    }

    @Override
    public String toString() {
        return "Result{" +
                "code=" + code +
                ", success=" + success +
                ", message='" + message + '\'' +
                ", remarks=" + remarks +
                '}';
    }

    public int getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getRemarks() {
        return remarks;
    }

    public void setRemarks(Object remarks) {
        this.remarks = remarks;
    }

    public Result(Integer code, boolean success, String message, Object remarks) {
        this.code = code;
        this.success = success;
        this.message = message;
        this.remarks = remarks;
    }

    public Result(boolean success, String message, Object remarks) {
        this.code = 0;
        this.success = success;
        this.message = message;
        this.remarks = remarks;
    }

    public Result(boolean success, String message) {
        this.code = 0;
        this.success = success;
        this.message = message;
    }

    public Result(String message) {
        this.code = 0;
        this.message = message;
        this.success = false;
    }

    public Result(Integer code, boolean success, String message) {
        this.code = code;
        this.success = success;
        this.message = message;
    }

    public Result( boolean success, Object remarks) {
        this.code = 0;
        this.success = success;
        this.remarks = remarks;
    }
}
